package controllers

import (
	// "encoding/json"
	// "hapi/models"
	// "fmt"
	"github.com/astaxie/beego"
)

// Operations about aritcles
type ArticleController struct {
	beego.Controller
}

// @Title AddArticle
// @Description Logs user into the system
// @Param	body		body 	string	true		"body for article content"
// @Success 200 {string} string
// @Failure 403 body is empty
// @router / [post]
func (u *ArticleController) AddArticle() {

	tokenstr := "token"
	u.Data["json"] = map[string]string{"token": tokenstr}
	u.Ctx.ResponseWriter.Header().Add("Access-Control-Allow-Origin", "*")
	u.Ctx.Output.Header("Access-Control-Allow-Origin", "*")
	// u.Ctx.ResponseWriter.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
	u.ServeJSON()
}